Fix block_attach_shared tests. When the sharing check succeeds, the domain
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Thu, 15 Dec 2005 13:49:07 +0000 (13:49 +0000)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Thu, 15 Dec 2005 13:49:07 +0000 (13:49 +0000)
is created but left paused, so it is necessary to destroy the domain afterwards,
whether the test succeeded or failed.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py
tools/xm-test/tests/block-create/12_block_attach_shared_domU.py

index adf7ca5ea5d2e4a598ce328c5b2523e0a6f22b71..f2e5ca7d64f0f0c49b775d216b30b07b96fb2723 100644 (file)
@@ -34,3 +34,5 @@ try:
     FAIL("Bug #331: Started a DomU with write access to a rw mounted block device")
 except DomainError, e:
     s, o = traceCommand("umount mnt")
+
+domain.destroy()
index c0ce5bee8a6eb9bcc4259654ac02d120651c2f31..07cf56c373983b4ca9ee408597673b8298bf787d 100644 (file)
@@ -20,8 +20,11 @@ except DomainError, e:
     FAIL("Unable to start domain")
 
 try:
-    dom2.start()
-    dom1.destroy()
-    FAIL("Bug #331: Started a DomU with write access to an in-use block device")
-except DomainError, e:
+    try:
+        dom2.start()
+        FAIL("Bug #331: Started a DomU with write access to an in-use block device")
+    except DomainError, e:
+        pass
+finally:
     dom1.destroy()
+    dom2.destroy()